package com.example.demo.utils;

import com.example.demo.api.error.ErrorResult;
import com.example.demo.bean.bis.Picture;
import com.example.demo.service.exception.ErrorCode;

/**
 * @author zzz
 * @Title: ResultUtil
 * @ProjectName test
 * @Description: TODO(返回结果工具类)
 * @date 2018/7/12
 */
public class ResultUtil {

    public static ErrorResult error(int code, String msg) {
        ErrorResult result = new ErrorResult();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
    public static ErrorResult error(ErrorCode errorCode) {
        ErrorResult result = new ErrorResult();
        result.setCode(errorCode.code);
        result.setMsg(errorCode.message);
        return result;
    }
}
